package com.yc.biz;

import com.yc.bean.BankAccount;

import com.yc.dao.BankDao;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@RequiredArgsConstructor
@Transactional
public class BankAccountBizImpl implements BankAccountBiz {

    private final BankDao bankDao;



    @Transactional(readOnly = true)
    public List<BankAccount> showAll(){
        List<BankAccount> list=this.bankDao.selectList(  null  );
        return list;
    }

    public BankAccount openAccount( BankAccount bankAccount  ){
        this.bankDao.insert( bankAccount );
        return bankAccount;
    }
}
